<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script>
    var arr = ["hello",1,4,7]
    Array.prototype.myForEach = function(){
        for(var i=0; i<this.length; i++) {
            arguments[0].call(window,this[i],i,this)
        }
    }
    arr.myForEach(function(item,index,arr){
        console.log(item)
        console.log(this)
    })

    // arr.forEach(function(item,index,arr) {
    //     console.log(this)
    // })

</script>
<body>
    
</body>
</html>